#include <iostream>
using namespace std;

string addStrings(string num1, string num2) {
    int end1 = num1.size() - 1, end2 = num2.size() - 1;
    string ret;

    int next = 0;
    while (end1 >= 0 || end2 >= 0)
    {
        int val1 = end1 >= 0 ? num1[end1--] - '0' : 0;
        int val2 = end2 >= 0 ? num2[end2--] - '0' : 0;

        int num = val1 + val2 + next;
        next = num / 10;
        num = num % 10;

        ret += (num + '0');
    }

    if (next == 1)
        ret += (next + '0');

    reverse(ret.begin(), ret.end());

    return ret;
}

int main()
{
    string num1 = "234";
    string num2 = "432";
    string ans = addStrings(num1, num2);
    cout << ans << endl;
    return 0;
}